﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="query.aspx.cs" Inherits="AnyOffice.general.address.public1.tquery" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>query</title>
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		
		<script>
function add_detail(address_id)
{
 URL="address_detail.aspx?address_id="+address_id;
 myleft=(screen.availWidth-500)/2;
 window.open(URL,"detail","height=550,width=400,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=50,left="+myleft+",resizable=yes");
}

function delete_add(address_id)
{
 msg='确认要删除该联系人么？';
 if(window.confirm(msg))
 {
  URL="address_delete.aspx?address_id=" + address_id + "&group_id=0";
  window.location=URL;
 }
}

		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
			<table class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
				<tr>
					<td class="Big"><IMG src="/images/menu/address.gif" align="absMiddle"><span class="big3">&nbsp;<asp:Literal id="litNavName" runat="server" Text="联系人查询"></asp:Literal></span>
					</td>
				</tr>
			</table>
			<br>
			<asp:Panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="1" cellPadding="2" width="400" align="center" bgColor="#000000"
					border="0">
					<TR>
						<TD class="TableData" noWrap>分组：</TD>
						<TD class="TableData" noWrap>
							<asp:dropdownlist id="ddlGroupId" runat="server" CssClass="BigSelect"></asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>姓名：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtName" runat="server" CssClass="BigInput" Columns="10" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>性别：</TD>
						<TD class="TableData">
							<asp:dropdownlist id="ddlSex" runat="server" CssClass="BigSelect">
								<asp:ListItem Value="all" Selected="True">所有</asp:ListItem>
								<asp:ListItem Value="True">男</asp:ListItem>
								<asp:ListItem Value="False">女</asp:ListItem>
							</asp:dropdownlist></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>昵称：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtNickName" runat="server" CssClass="BigInput" Columns="25" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>单位名称：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtDeptName" runat="server" CssClass="BigInput" Columns="25" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>单位地址：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtDeptAddr" runat="server" CssClass="BigInput" Columns="25" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>家庭住址：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtHomeAddr" runat="server" CssClass="BigInput" Columns="25" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableData" noWrap>备注：</TD>
						<TD class="TableData">
							<asp:TextBox id="txtNote" runat="server" CssClass="BigInput" Columns="25" MaxLength="50"></asp:TextBox></TD>
					</TR>
					<TR>
						<TD class="TableControl" noWrap align="center" colSpan="2">&nbsp;
							<asp:Button id="btnSubmit" runat="server" CssClass="BigButton" Text="查询"></asp:Button></TD>
					</TR>
				</TABLE>
			</asp:Panel>
			<asp:Panel id="pnlQuery" runat="server" Visible="False">
				<asp:Repeater id="rptAddress" runat="server" EnableViewState="False">
					<HeaderTemplate>
						<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3">
							<tr class="TableHeader">
								<td nowrap align="center">姓名</td>
								<td nowrap align="center">性别</td>
								<td nowrap align="center">单位电话</td>
								<td nowrap align="center">家庭电话</td>
								<td nowrap align="center">手机</td>
								<td nowrap align="center">电子邮件</td>
								<td nowrap align="center">操作</td>
							</tr>
					</HeaderTemplate>
					<ItemTemplate>
						<tr class="TableLine1">
							<td nowrap align="center"><a href="javascript:add_detail('<%#Eval("AddressId")%>');"><%#Eval("Name")%></a></td>
							<td nowrap align="center"><%#Convert.ToBoolean(Eval("Sex")) == true ? "男" : "女"%></td>
							<td nowrap align="center"><%#Eval("DeptTel")%></td>
							<td nowrap align="center"><%#Eval("HomeTel")%></td>
							<td nowrap align="center"><a target="_blank" title="发送手机短信" href="/general/mobile/new.aspx?mobile=<%#Eval("Mobile")%>"><%#Eval("Mobile")%></a></td>
							<td nowrap align="center"><a href="mailto:<%#Eval("Email")%>"><%#Eval("Email")%></a></td>
							<td nowrap align="center" width="100">
								<a href="javascript:add_detail('<%#Eval("AddressId")%>');"> 详情</a>
							</td>
						</tr>
				</ItemTemplate>
				<AlternatingItemTemplate>
				<tr class="TableLine2">
							<td nowrap align="center"><a href="javascript:add_detail('<%#Eval("AddressId")%>');"><%#Eval("Name")%></a></td>
							<td nowrap align="center"><%#Convert.ToBoolean(Eval("Sex")) == true ? "男" : "女"%></td>
							<td nowrap align="center"><%#Eval("DeptTel")%></td>
							<td nowrap align="center"><%#Eval("HomeTel")%></td>
							<td nowrap align="center"><a target="_blank" title="发送手机短信" href="/general/mobile/new.aspx?mobile=<%#Eval("Mobile")%>"><%#Eval("Mobile")%></a></td>
							<td nowrap align="center"><a href="mailto:<%#Eval("Email")%>"><%#Eval("Email")%></a></td>
							<td nowrap align="center" width="100">
								<a href="javascript:add_detail('<%#Eval("AddressId")%>');"> 详情</a>
							</td>
						</tr>
				</AlternatingItemTemplate>
					<FooterTemplate>
						</table>
					</FooterTemplate>
				</asp:Repeater>
				<asp:Literal id="litMessage" runat="server"></asp:Literal>
				<br>
				<CENTER><INPUT class="BigButton" onclick="window.location='query.aspx';" type="button" value="返回"></CENTER>
			</asp:Panel>
		</form>
	</body>
</HTML>
